package com.all.shiro.controller;

import com.all.shiro.model.dto.LoginDto;
import com.all.shiro.response.ResponseMessage;
import com.all.shiro.response.ResponseMessageFactory;
import com.all.shiro.service.ISysUserService;
import jakarta.annotation.Resource;
import lombok.extern.slf4j.Slf4j;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RestController;

/**
 * @Author LY
 * @create 2024/4/3 17:35
 * @Description 登录
 */
@RestController
@Slf4j
public class LoginController {

    @Resource
    private ISysUserService iSysUserService;

    @PostMapping("/login")
    public ResponseMessage<Void> login(@RequestBody LoginDto dto){
        log.info("登录:{}", dto.toString());
        iSysUserService.login(dto);
        return ResponseMessageFactory.getSuccessResponseMessage();
    }
}
